package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDate;

/**订单类*/
@Data
@ApiModel(value = "订单类")
@TableName("t_order")
public class OrderBean {
    /**订单编号*/
    @ApiModelProperty(hidden = true)
    @TableId(value = "pk_orderId",type = IdType.AUTO)
    private Integer id;
    /**下单时间*/
    @ApiModelProperty(value = "下单时间")
    @TableField("o_date")
    private LocalDate createDate;
    /**总价*/
    @ApiModelProperty(value = "总价")
    @TableField("o_totalPrice")
    private double totalPrice;
    /**用户id*/
    @ApiModelProperty(value = "用户id")
    @TableField("o_userId")
    private Integer userId;
    /**收货地址*/
    @ApiModelProperty(value = "收货地址")
    @TableField("o_address")
    private String address;
    /**订单状态*/
    @ApiModelProperty(value = "订单状态")
    @TableField("o_status")
    private String status = "未发货";

    public OrderBean() {
    }

    public OrderBean(LocalDate createDate, double totalPrice,
                     Integer userId, String address) {
        this.createDate = createDate;
        this.totalPrice = totalPrice;
        this.userId = userId;
        this.address = address;
    }

    @Override
    public String toString() {
        return "\nOrderBean{" +
                "id=" + id +
                ", createDate=" + createDate +
                ", totalPrice=" + totalPrice +
                ", userId=" + userId +
                ", address='" + address + '\'' +
                ", status='" + status + '\'' +
                '}';
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public LocalDate getCreateDate() {
        return createDate;
    }

    public void setCreateDate(LocalDate createDate) {
        this.createDate = createDate;
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(double totalPrice) {
        this.totalPrice = totalPrice;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
}
